package com.pet.shop.controller.sys;

import com.pet.shop.entity.option.DataOptionView;
import com.pet.shop.service.option.IDataOptionService;
import com.pet.shop.utils.ApiResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.Map;

@RequestMapping("/api/option/")
@RestController
public class DataOptionApiController {

    @Autowired
    private IDataOptionService dataOptionService;
    /**
     *
     * @return
     */
    @RequestMapping("/relayTimes")
    public Map<String, Object> relayList(){
        DataOptionView value = dataOptionService.queryDataOptionValByKeyId(-1L, "relayTimes");
        return ApiResultUtil.success_data(Arrays.asList(value.getValue().split(",")));
    }
}
